// DlgProxy.cpp : implementation file
//

#include "stdafx.h"
#include "TestTTS.h"
#include "DlgProxy.h"
#include "TestTTSDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTestTTSDlgAutoProxy

IMPLEMENT_DYNCREATE(CTestTTSDlgAutoProxy, CCmdTarget)

CTestTTSDlgAutoProxy::CTestTTSDlgAutoProxy()
{
	EnableAutomation();
	
	// To keep the application running as long as an automation 
	//	object is active, the constructor calls AfxOleLockApp.
	AfxOleLockApp();

	// Get access to the dialog through the application's
	//  main window pointer.  Set the proxy's internal pointer
	//  to point to the dialog, and set the dialog's back pointer to
	//  this proxy.
	ASSERT (AfxGetApp()->m_pMainWnd != NULL);
	ASSERT_VALID (AfxGetApp()->m_pMainWnd);
	ASSERT_KINDOF(CTestTTSDlg, AfxGetApp()->m_pMainWnd);
	m_pDialog = (CTestTTSDlg*) AfxGetApp()->m_pMainWnd;
	m_pDialog->m_pAutoProxy = this;
}

CTestTTSDlgAutoProxy::~CTestTTSDlgAutoProxy()
{
	// To terminate the application when all objects created with
	// 	with automation, the destructor calls AfxOleUnlockApp.
	//  Among other things, this will destroy the main dialog
	if (m_pDialog != NULL)
		m_pDialog->m_pAutoProxy = NULL;
	AfxOleUnlockApp();
}

void CTestTTSDlgAutoProxy::OnFinalRelease()
{
	// When the last reference for an automation object is released
	// OnFinalRelease is called.  The base class will automatically
	// deletes the object.  Add additional cleanup required for your
	// object before calling the base class.

	CCmdTarget::OnFinalRelease();
}

BEGIN_MESSAGE_MAP(CTestTTSDlgAutoProxy, CCmdTarget)
	//{{AFX_MSG_MAP(CTestTTSDlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CTestTTSDlgAutoProxy, CCmdTarget)
	//{{AFX_DISPATCH_MAP(CTestTTSDlgAutoProxy)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()

// Note: we add support for IID_ITestTTS to support typesafe binding
//  from VBA.  This IID must match the GUID that is attached to the 
//  dispinterface in the .ODL file.

// {9BF0E323-35E2-4B1A-A942-178C4FF14682}
static const IID IID_ITestTTS =
{ 0x9bf0e323, 0x35e2, 0x4b1a, { 0xa9, 0x42, 0x17, 0x8c, 0x4f, 0xf1, 0x46, 0x82 } };

BEGIN_INTERFACE_MAP(CTestTTSDlgAutoProxy, CCmdTarget)
	INTERFACE_PART(CTestTTSDlgAutoProxy, IID_ITestTTS, Dispatch)
END_INTERFACE_MAP()

// The IMPLEMENT_OLECREATE2 macro is defined in StdAfx.h of this project
// {6B32B0B3-9F0D-4226-83A1-674A1D935A1C}
IMPLEMENT_OLECREATE2(CTestTTSDlgAutoProxy, "TestTTS.Application", 0x6b32b0b3, 0x9f0d, 0x4226, 0x83, 0xa1, 0x67, 0x4a, 0x1d, 0x93, 0x5a, 0x1c)

/////////////////////////////////////////////////////////////////////////////
// CTestTTSDlgAutoProxy message handlers
